package 人类;

/**
 * @author ：wang-ting
 * @Date：2025/6/22 22:01
 */
public class Person3 extends Person0 implements Comparable<Person3> {
    public Person3(String n, int a) {
        super(n, a);
    }

    @Override
    public int compareTo(Person3 other) {
        int ageCompare = this.age - other.age;
        if (ageCompare != 0) {
            return ageCompare;
        }
        return this.name.compareTo(other.name);
    }
}
